

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
<script type="text/javascript" src="helpman_topicinit.js"></script>

<title>Connect to the Interface [Enterprise Architect User Guide]</title>

<meta name="keywords" content="Enterprise Architect, Sparx Systems, UML, Connect,Connect To Automation Interface,Automation Interface,Automation Interface Connect From MS Visual Basic 6.0,Automation Interface Connect From Borland Delphi 7.0,Automation Interface Connect From MS C#,Automation Interface Connect From Java,Visual Basic,Visual Basic Connect To Automation Interface">
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<meta http-equiv="Content-Style-Type" content="text/css" />

<link type="text/css" href="default.css" rel="stylesheet" />
<style type="text/css">
  A, A:Visited
  {
    color: #00F;
  }

  A:Active, A:Hover
  {
    color: #F00;
  }

  OL
  {
    margin: 5px 0 5px 48px;
  }

  UL
  {
    margin-bottom: 3px;
    margin-top: 0;
  }

  #nsr
  {
    background-color: #D4DFFF;
  }

  #nsr A
  {
    text-decoration: none;
  }

  #mainbody
  {
    padding: 8px;
  }

  .p_BodyText
  {
    padding: 5px 0;
  }
</style>



<style type="text/css" media="screen">
  BODY
  {
    background-color: #FFFFFF;
  }

  #nsr
  {
    padding: 6px 6px 0 6px;
    border-bottom: none;
    vertical-align: top;
    z-index: 2;
    visibility: visible;
    left: 0;
    top: 0;
    position: absolute;
  }

  #mainbody
  {
    left: 0;
    top: 0;
    margin: 0;
    position: absolute;
    padding: 10px;
    overflow: auto;
    height: 100%;
    z-index: 1;
    background-repeat: no-repeat;
    background-position: bottom right;
    background-attachment: fixed;
  }
</style>

<style type="text/css" media="print">
  #nsr
  {
    visibility: none;
  }

  #mainbody
  {
    overflow: visible;
  }
</style>
<script type="text/javascript" language="JavaScript" src="nonscroll.js"></script>

</head>
<body scroll="no">

<div id="page">



        <div id="content">
          <div id="content-inner">
          



  
          <div id="nsr">
            <table border="0" cellspacing="0" cellpadding="4" width="100%">
              <tr valign="top">
                <td align="left">
  


                  <p class="p_Heading1"><span class="f_Heading1">Connect to the Interface</span></p>



  
                </td>
                <td align="right">
                  <a href="introduction.htm" onmouseover="document.images.main.src='button_main_h.gif'" onmouseout="document.images.main.src='button_main.gif'">
                    <img name="main" src="button_main.gif" border=0 alt="Return to Introduction">
                  </a>&nbsp;
    
                  <a href="usingtheautomationinterface.htm" onmouseover="document.images.prev.src='button_prev_h.gif'" onmouseout="document.images.prev.src='button_prev.gif'">
                    <img name=prev src="button_prev.gif" border=0 alt="Previous page" />
                  </a>&nbsp;
    
    
    
                  <a href="setupvb.htm" onmouseover="document.images.next.src='button_next_h.gif'" onmouseout="document.images.next.src='button_next.gif'">
                    <img name=next src="button_next.gif" border=0 alt="Next page" />
                  </a>
    
    
                </td>
              </tr>
            </table>
          </div>
          <div id="mainbody">
  


                <p class="p_BodyText"><span class="f_BodyText">All development environments capable of generating ActiveX Com clients should be able to connect to the Enterprise Architect Automation Interface.</span></p>
<p class="p_BodyText"><span class="f_BodyText">By way of example, the following sections describe how to connect using several such tools. The procedure might vary slightly with different versions of these products.</span></p>
<p class="p_SubHeadingL1"><span class="f_SubHeadingL1">Microsoft Visual Basic 6.0 </span></p>
<ol style="text-indent: 0px; margin-left: 48px; list-style-position: outside;">
<li value=1><span class="f_NumberedList">Create a new project.</span></li>
<li value=2><span class="f_NumberedList">Select the </span><span class="f_MenuKeyField">Project | References</span><span class="f_NumberedList"> menu option.</span></li>
<li value=3><span class="f_NumberedList">Select </span><span class="f_NumberedList" style="font-style: italic;">Enterprise Architect Object Model 2.0</span><span class="f_NumberedList"> from the list. (If this does not appear, go to the command line and re-register Enterprise Architect using </span><br>
<span class="f_NumberedList">&nbsp;</span><br>
<span class="f_NumberedList" style="font-style: italic;">EA.exe /unregister</span><br>
<span class="f_NumberedList">&nbsp;</span><br>
<span class="f_NumberedList">then</span><br>
<span class="f_NumberedList" style="font-style: italic;">&nbsp;</span><br>
<span class="f_NumberedList" style="font-style: italic;">EA.exe /register</span><span class="f_NumberedList">).</span></li>
<li value=4><span class="f_NumberedList">See the general library documentation on the use of Classes. The following example creates and opens a repository object:</span><br>
<span class="f_NumberedList"> &nbsp;&nbsp; </span></li>
</ol>
<p class="p_Code"><span class="f_Code">Public Sub ShowRepository()</span></p>
<p class="p_Code"> &nbsp; &nbsp; &nbsp; &nbsp;<span class="f_Code">Dim MyRep As New EA.Repository</span></p>
<p class="p_Code"> &nbsp; &nbsp; &nbsp; &nbsp;<span class="f_Code">MyRep.OpenFile &quot;c:\eatest.eap&quot;</span></p>
<p class="p_Code"><span class="f_Code">End Sub</span></p>
<p class="p_SubHeadingL1"><span class="f_SubHeadingL1">Borland Delphi 7.0</span><span class="f_SubHeadingL1"> </span></p>
<ol style="text-indent: 0px; margin-left: 48px; list-style-position: outside;">
<li value=1><span class="f_NumberedList">Create a new project.</span></li>
<li value=2><span class="f_NumberedList">Select the </span><span class="f_MenuKeyField">Project | Import Type Library</span><span class="f_NumberedList"> menu option.</span></li>
<li value=3><span class="f_NumberedList">Select </span><span class="f_MenuKeyField">Enterprise Architect Object Model 2.0</span><span class="f_NumberedList"> from the list. (If this does not appear, go to the command line and re-register Enterprise Architect using </span><br>
<span class="f_NumberedList">&nbsp;</span><br>
<span class="f_NumberedList" style="font-style: italic;">EA.exe /unregister</span><br>
<span class="f_NumberedList">&nbsp;</span><br>
<span class="f_NumberedList">then</span><br>
<span class="f_NumberedList" style="font-style: italic;">&nbsp;</span><br>
<span class="f_NumberedList" style="font-style: italic;">EA.exe /register</span><span class="f_NumberedList">).</span></li>
<li value=4><span class="f_NumberedList">Click on the </span><span class="f_MenuKeyField">Create Unit</span><span class="f_NumberedList"> button.</span></li>
<li value=5><span class="f_NumberedList">Include </span><span class="f_NumberedList" style="font-style: italic;">EA_TLB</span><span class="f_NumberedList"> in Project1's </span><span class="f_NumberedList" style="font-style: italic;">Uses</span><span class="f_NumberedList"> clause.</span></li>
<li value=6><span class="f_NumberedList">See the general library documentation on the use of Classes. The following example creates and opens a repository object:</span><br>
<span class="f_NumberedList">&nbsp;</span></li>
</ol>
<p class="p_Code" style="margin: 0px 0px 0px 49px;"><span class="f_Code">procedure TForm1.Button1Click(Sender: TObject);</span></p>
<p class="p_Code" style="margin: 0px 0px 0px 49px;"><span class="f_Code">var</span></p>
<p class="p_Code" style="margin: 0px 0px 0px 49px;"> &nbsp; &nbsp; &nbsp; &nbsp;<span class="f_Code">r: TRepository;</span></p>
<p class="p_Code" style="margin: 0px 0px 0px 49px;"> &nbsp; &nbsp; &nbsp; &nbsp;<span class="f_Code">b: boolean;</span></p>
<p class="p_Code" style="margin: 0px 0px 0px 49px;"><span class="f_Code">begin</span></p>
<p class="p_Code" style="margin: 0px 0px 0px 49px;"> &nbsp; &nbsp; &nbsp; &nbsp;<span class="f_Code">r := TRepository.Create(nil);</span></p>
<p class="p_Code" style="margin: 0px 0px 0px 49px;"> &nbsp; &nbsp; &nbsp; &nbsp;<span class="f_Code">b := r.OpenFile('c:\eatest.eap');</span></p>
<p class="p_Code" style="margin: 0px 0px 0px 49px;"><span class="f_Code">end;</span></p>
<p class="p_SubHeadingL1"><span class="f_SubHeadingL1">Microsoft C#</span><span class="f_SubHeadingL1"> </span></p>
<ol style="text-indent: 0px; margin-left: 48px; list-style-position: outside;">
<li value=1><span class="f_NumberedList">Select the Visual Studio </span><span class="f_MenuKeyField">Project</span><span class="f_NumberedList"> | </span><span class="f_MenuKeyField">Add Reference </span><span class="f_NumberedList">menu option.</span></li>
<li value=2><span class="f_NumberedList">Click on the </span><span class="f_UIControl">Browse</span><span class="f_NumberedList"> tab.</span></li>
<li value=3><span class="f_NumberedList">Navigate to the folder in which you installed Enterprise Architect (usually </span><span class="f_Code">Program Files/Sparx Systems/EA</span><span class="f_NumberedList">) and select </span><span class="f_Code">Interop.EA.dll</span><span class="f_NumberedList">.</span></li>
<li value=4><span class="f_NumberedList">See the general library</span><span class="f_NumberedList"> documentation on the use of Classes. The following example creates and opens a repository object: </span></li>
</ol>
<p class="p_Code" style="margin: 0px 0px 0px 48px;"><span class="f_Code">&nbsp;</span></p>
<p class="p_Code" style="margin: 0px 0px 0px 48px;"><span class="f_Code">private void button1_Click(object sender, System.EventArgs e)</span></p>
<p class="p_Code" style="margin: 0px 0px 0px 48px;"><span class="f_Code">{</span></p>
<p class="p_Code" style="margin: 0px 0px 0px 48px;"> &nbsp; &nbsp; &nbsp; &nbsp;<span class="f_Code">EA.Repository r = new EA.RepositoryClass();</span></p>
<p class="p_Code" style="margin: 0px 0px 0px 48px;"> &nbsp; &nbsp; &nbsp; &nbsp;<span class="f_Code">r.OpenFile(&quot;c:\\eatest.eap&quot;);</span></p>
<p class="p_Code" style="margin: 0px 0px 0px 48px;"><span class="f_Code">}</span></p>
<p class="p_SubHeadingL1"><span class="f_SubHeadingL1">Java</span></p>
<ol style="text-indent: 0px; margin-left: 48px; list-style-position: outside;">
<li value=1><span class="f_NumberedList">Copy the file </span><span class="f_Code">SSJavaCOM.dll</span><span class="f_NumberedList"> from the </span><span class="f_Code">Java API</span><span class="f_NumberedList"> subdirectory of your installed directory (usually </span><span class="f_Code">Program Files/Sparx Systems/EA</span><span class="f_NumberedList">) into any location within the Windows PATH. For example, the </span><span class="f_Code">windows\system32</span><span class="f_NumberedList" style="font-style: italic;"> </span><span class="f_NumberedList">directory.</span></li>
<li value=2><span class="f_NumberedList">Copy the </span><span class="f_Code">eaapi.jar</span><span class="f_NumberedList"> file from the </span><span class="f_NumberedList" style="font-style: italic;">Java API</span><span class="f_NumberedList"> subdirectory of your installed directory (usually </span><span class="f_Code">Program Files/Sparx Systems/</span><span class="f_Code">EA</span><span class="f_NumberedList">) to a location in the Java CLASSPATH or where the Java class loader can find it at run time.</span></li>
<li value=3><span class="f_NumberedList">All of the Classes described in the documentation are in the package </span><span class="f_Code">org.sparx</span><span class="f_NumberedList">. See the <a href="reference.htm">general library documentation</a> for their use. The following example creates and opens a repository object.</span><br>
<span class="f_NumberedList">&nbsp;</span></li>
</ol>
<p class="p_Code" style="margin: 0px 0px 0px 48px;"><span class="f_Code">public void OpenRepository()</span></p>
<p class="p_Code" style="margin: 0px 0px 0px 48px;"><span class="f_Code">{</span></p>
<p class="p_Code" style="margin: 0px 0px 0px 48px;"><span class="f_Code"> &nbsp;&nbsp; org.sparx.Repository r = new org.sparx.Repository();</span></p>
<p class="p_Code" style="margin: 0px 0px 0px 48px;"><span class="f_Code"> &nbsp;&nbsp; r.OpenFile(&quot;c:\\eatest.eap&quot;);</span></p>
<p class="p_Code" style="margin: 0px 0px 0px 48px;"><span class="f_Code">}</span></p>




            </div>
          </div>
        </div>



</div>


</body>
</html>
